Home:ALL Converter>could not open version file PG_VERSION postgresql pg upgrade

could not open version file PG_VERSION postgresql pg upgrade

Ask Time:2019-11-16T04:44:20         Author:Dase M

Json Formatter

I need some help please, I am upgrading postgresql from v10 to v11 on Windows, but get the following error message: could not open version file: C:/Program Files/PostgresSQL/11/data/PG_VERSION.

Here are the steps taken:

  1. Stopped both PostgresSQL v10 and PostgresSQL v11 services using

    services.msc
    
  2. Set full access control/complete permissions for users for both v10 and v11.

  3. Created 'postgres' user account with full admin rights.
  4. Opened command-line and entered

    RUNAS /USER:postgres "CMD.EXE
    

    prompted to enter password for user postgres user.

  5. New command-line window opens and cd to 'C:\Program Files\PostgreSQL\11'.

  6. Entered the following:
pg_upgrade.exe --old-datadir "C:/Program Files/PostgreSQL/10/data" --new-datadir "C:/Program Files/PostgreSQL/11/data" --old-bindir "C:/Program Files/PostgreSQL/10/bin" --new-bindir "C:/Program Files/PostgreSQL/11/bin" --check

On pressing enter I get the above mentioned error.

I am new to the whole process of using PostgreSQL.

Any thoughts on what is wrong?

Author:Dase M,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/58884434/could-not-open-version-file-pg-version-postgresql-pg-upgrade
rhellem :

I had to grant \\postgres modify access to both the old and the new datadirectory. That solved the problem for me while upgrading from 9.6 to 10",
2021-11-16T13:51:39
yy